<template>
  <viewFileModal ref="registerViewFileModal" @success="handleSuccess"></viewFileModal>
</template>

<script lang="ts" name="ViewFileDetail" setup>
import { ref } from 'vue';
import viewFileModal from '/@/views/filerecord/components/viewFileModal.vue'; // 确保路径正确

const registerViewFileModal = ref();

// 查看文件详情的方法
function viewFileDetail(url: string) {
  if (url && url.length > 0) {
    registerViewFileModal.value.disableSubmit = true;
    registerViewFileModal.value.view(url);
  }
}

// 定义一个事件，供父组件调用
const emit = defineEmits(['view-file']);
emit('view-file', viewFileDetail);
</script>
